export default {
/**
* 定义命名空间，防止多个模块同名共享，使用时需要带上命名空间
*/
    namespaced: true,
    state: {
        myLoveList: [],
        myName: 'zjq',
        myRuning: false,
    },
    mutations: {
        // addMyLoveList({ myLoveList}, item) {
        //     myLoveList.push(item)
        // },
        addMyLoveList(state, item) {
            state.myLoveList.push(item)
        },
        clearMyLoveList(state) {
            state.myLoveList = []
        },
        changeMyName(state, newName) {
            state.myName = newName
        },
        changeMyRuning(state) {
            state.myRuning = !state.myRuning
        }
    },
    actions: {
        setTimeoutChangeMyName({ commit }, newName) {
            setTimeout(() => { commit('changeMyName', newName) })
        }
    },
    getters: {
        getAll(state) {
            return String(state.myLoveList) + state.myName + state.myRuning
        }
    }
}